# Contributor: Vinay S Shastry <vinayshastry@gmail.com>

pkgname="rpm"
pkgver=4.8.1
pkgrel=1
pkgdesc="Red Hat Package Manager"
arch=('i686' 'x86_64')
url="http://www.rpm.org/"
license=('GPL')
depends=('bzip2' 'sqlite3' 'popt' 'neon' 'beecrypt' 'db')
source=(http://rpm.org/releases/rpm-4.8.x/rpm-${pkgver}.tar.bz2)
md5sums=('85b9cabd384ffe47b7c3ffb396133fb1')

build() {
  cd $startdir/src/$pkgname-${pkgver}

  export CFLAGS="-DDB_XA_CREATE=0x2 -I/usr/include/nss -I/usr/include/nspr $CFLAGS"
  export CPPFLAGS="-DDB_XA_CREATE=0x2 -I/usr/include/nspr -I/usr/include/nss $CPPFLAGS"
  rm -rf popt

  [ $NOEXTRACT -eq 1 ] || ./configure --prefix=/usr --without-python --without-selinux \
              --without-perl --with-external-db --localstatedir=/var --enable-sqlite3
  make
  make DESTDIR=$startdir/pkg install
}
